package com.xmx.confu.entity.controller;

import com.xmx.confu.entity.entity.Audit;
import com.xmx.confu.entity.entity.Category;
import com.xmx.confu.entity.mapper.AuditMapper;
import com.xmx.confu.entity.service.IAuditService;
import com.xmx.confu.entity.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dinzhen
 * @since 2024-04-22
 */

@RestController
@RequestMapping("/audit")
public class AuditController {

    @Autowired
    private IAuditService auditService;

    @Autowired
    private ICategoryService iCategoryService;


    @GetMapping("/getall")
    public List<Audit> getAudit(){
        List<Audit> auditList = auditService.list();
        return auditList;
    }

    @GetMapping("/getCate")
    public List<Category> getCategory(){
        List<Category> categoryList = iCategoryService.list();
        return categoryList;
    }

    @GetMapping("/get")
    public String w(){
        return "haihaihaihaiahihai";
    }


}
